<?php
$this->keywords = $title.','.$this->keywords;
$this->pageTitle = $title;
$this->breadcrumbs=array(
	'所有商品类目'=> array('cate/index'),
	$parent->name => array('cate/subcate','pid'=>$parent->cid),
	$title,
);
?>
<div class="goods_header">
	<div class="sort">
		<?php $this->widget('ext.SortItems');?>
	</div>
	<h3><?php echo $title;?></h3>

</div>
<div class="similar_cates">
	<strong>相关分类:</strong>
	<?php $this->widget('ext.SimilarCates',array('pid'=>$parent->cid));?>
</div>
<div class="goods">
<?php
if(!count($data['taobaoke_items_get_response']['taobaoke_items']['taobaoke_item'])){
	echo '该类目下还没有商品!';
	echo '</div><!-- goods -->';
}else{
	foreach($data['taobaoke_items_get_response']['taobaoke_items']['taobaoke_item'] as $k => $d){
	?>
	<div class="good_wp">
		<div class="good_info">
			<div class="good_img"><a href="<?php echo $this->createUrl('item/detail',array('iid'=>$d['num_iid']));?>" target="_blank"><img src="<?php echo $d['pic_url'];?>" alt="<?php echo $d['title'];?>" /></a></div>
			<p class="good_title"><a href="<?php echo $this->createUrl('item/detail',array('iid'=>$d['num_iid']));?>" target="_blank" title="<?php echo $d['title'];?>"><?php echo mb_substr($d['title'],0,34,'utf-8');?></a></p>
			<p class="good_price"><span>￥</span><?php echo $d['price'];?><span> (30天售出 <?php echo $d['volume'];?> 件)</span></p>
			<p class="good_credit"><span>卖家信用：</span><img src="<?php echo Yii::app()->baseUrl.'/images/credit/'.$d['seller_credit_score'].'.gif';?>" /></p>
			<p class="good_link"><a href="<?php echo $this->createUrl('item/detail',array('iid'=>$d['num_iid']));?>" target="_blank">商品预览</a><a target="_blank" href="<?php echo $d['shop_click_url']; ?>">去TA店里逛逛</a><?php if(Yii::app()->user->name =='admin') echo  '<a href="'.$this->createUrl('publish/add',array('iid'=>$d['num_iid'])).'"  target="_blank">编辑文章</a>' ;?></p>
		</div>
	</div>

	<?php
	}
	?>
		<div class="clear"></div>
	</div> <!-- goods -->
	<div id="pager">
	<?php

	$this->widget('CLinkPager',array(
		'header'=>'',
		'firstPageLabel' => '首页',
		'lastPageLabel' => '末页',
		'prevPageLabel' => '上一页',
		'nextPageLabel' => '下一页',
		'pages' => $pager,
		'maxButtonCount'=>13
		)
	);

	Yii::app()->clientScript->registerScript('goods_hover',"
		$('.good_wp').mouseover(function (){
			$(this).css({'background':'#F1F7FD','border-color':'#0099CC'});}).mouseout(function (){
			$(this).css({'background':'#FFF','border-color':'#FFF'});
			});
	");
?>
	</div> <!-- pager -->
<?php 
}
?>